<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.anhry.app.safety.util.Util"%>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>上报列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/right.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/dbdialog/lhgdialog.js"></script>
	<script type="text/javascript" src="<%=path%>/js/selected.js"></script>
	<script type="text/javascript">
		$(function(){
			initSelArray('cUnit:1','cDept:1','cMinType:2');
			var cCounty = '${cCounty}';
			var cUnit = '${cUnit}';
			var cDept = '${cDept}';
			if(null!=cCounty && cCounty!=""){
				changeCounty(cCounty);
			}
	   		if(cUnit!=null && cUnit!=""){
	   			changeUnit(cUnit);
	   			selected('cUnit',cUnit);	//加载选中项
	   		}
	   		if(cDept!=null && cDept!=""){
	   			selected('cDept',cDept);	//加载选中项
	   		}
	   		
	   		var cMaxType = '${cMaxType}';
			var cMinType = '${cMinType}';
			if(null!=cMaxType && cMaxType!=""){
				changeType(cMaxType);
			}
			if(cMinType!=null && cMinType!=""){
	   			selected('cMinType',cMinType);	//加载选中项
	   		}
	   		
		});
		
		function changeCounty(cid){
	   		var urls='<%=basePath%>/util/data_getDept.action?cUnit='+cid+"&cCounty=1";
	   		buildSelect(cid, 'cUnit',urls,'1');
	   	}
	   	function changeUnit(uid){
	   		var urls="<%=basePath%>/util/data_getDept.action?cUnit="+uid;
	   		buildSelect(uid, 'cDept',urls,'1');
	   	}
	   	function changeType(maxid){
	   		var urls="<%=basePath%>/util/data_getCorpType.action?cMaxType="+maxid;
	   		buildSelect(maxid, 'cMinType',urls,'2');
	   	}
	   	function reSearch(){
	   		window.location.href='<%=basePath%>/zczb/xw_list.action?search=1';
	   	}
		
		function doFun(mth,id){
			document.form1.hzdId.value=id;
			if(mth==1){//查看
				document.form1.action='<%=basePath%>/zczb/xw_bgdList.action';
				document.form1.submit();
			}else if(mth==2){//核查
				$.ajax({
					type:"POST",
					url:"<%=basePath%>/zczb/xw_hzdLookCheck.action?hzdId="+id,
					success:function(data){
						if(data=="1"){
							infoDialog('hzdCheck','核查记录填写','750','380','<%=path%>/zczb/xw_hzdCheck.action?hzdId='+id+'');
						}else{
							alert('您还未查看该企业的自查记录，请先查看后在填写核查记录！');
						}	  			
				    }
				});
			}else if(mth==3){//删除
				var vf =confirm("删除企业上报数据后，企业要重新上报，您确定要删除该企业的上报信息吗？");
				if(vf){
					document.form1.action='<%=basePath%>/zczb/xw_hzdDele.action';
					document.form1.submit();
				}else{
					return;
				}
			}else if(mth==4){//部门查看情况
				infoDialog('hzdLook','部门查看情况','550','320','<%=path%>/zczb/xw_hzdLookShow.action?hzdId='+id+'');
			}else if(mth==5){//部门核查情况
				infoDialog('hzdCh','部门核查情况','750','420','<%=path%>/zczb/xw_hzdCheckShow.action?hzdId='+id+'');
			}
		}
	</script>
  </head>
  
  <body>
	<div  class="body-box">
		<div class="map">
			<div class="map_con">
				您当前的位置：自查自报 &gt; 小微企业上报管理 &gt; 上报列表
			</div>
		</div>
		<div id="container">
			<fieldset class="serarch_set">
				<legend>
			  		<div class="search">查询条件</div>
			  	</legend>
			  	<form action="<%=basePath%>/zczb/xw_list.action?search=1" method="post" name="zcForm">
			   		<label style="width: 80px;">属地：</label> 
			   			<s:select list="sdList" name="cCounty" listKey="id" listValue="deptName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cCounty" onchange="changeCounty(this.value);"></s:select>
			   			<s:select list="#{}" name="cUnit" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cUnit" onchange="changeUnit(this.value);"></s:select>
			   			<s:select list="#{}" name="cDept" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cDept"></s:select>
			   		<label style="width: 80px;margin-left:43px;">行业部门：</label><s:select list="hyList" name="cHy" value="%{cHy}" listKey="id" listValue="deptName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<br/>
			   		<label style="width: 80px;">企业类型：</label> 
			   			<s:select list="typeList" name="cMaxType" listKey="id" listValue="typeName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cMaxType" onchange="changeType(this.value);"></s:select> 
			   			<s:select list="#{}" name="cMinType" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cMinType"></s:select>
			   		<br/>
			   		<label style="width: 80px;">企业级别：</label>
			   			<s:select list="#{'A':'A','B':'B','C':'C','D':'D','E':'未评级' }" name="cGrade" value="%{cGrade}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   			核查状态：<s:select list="#{1:'未查看',2:'已查看',3:'未核查',4:'已核查'}" name="cHecha" listKey="key" listValue="value" value="%{cHecha}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   			隐患情况：<s:select list="#{1:'无隐患',2:'不合格',3:'未处理'}" name="cYh" listKey="key" listValue="value" value="%{cYh}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<br/>
			   		<label style="width: 80px;">上报年：</label>
			   			<s:select list="yearList" listKey="id" listValue="yearName" name="cYear" value="%{cYear}" theme="simple"></s:select>
			   		月份：
			   			<s:select list="#{1:'1',2:'2',3:'3',4:'4',5:'5',6:'6',7:'7',8:'8',9:'9',10:'10',11:'11',12:'12' }" name="cMonth" value="%{cMonth}" theme="simple"></s:select>
			   			<s:radio list="#{1:'已上报',2:'未上报'}" name="cIsup" value="%{cIsup}" theme="simple"></s:radio> 
			   		<br/>
			   		<label style="width: 80px;">企业名称：</label><input type="text" name="keyWord" value="${keyWord }" size="50%">
			   		<input type="submit" value="搜 索" class="link_input" name="btnsx">
			   		<input type="button" value="重置搜索条件" class="link_input" name="btnsx" onclick="reSearch();">
			   		<input type="hidden" name="num" value="${page.num }">
			   		<input type="hidden" name="size" value="${page.size }">
			  	</form>
			</fieldset>
		  	<table border="0" cellpadding="0" cellspacing="0" class="mytable">
		   		<thead>
			    	<tr class="fixedHeaderTr">
			     		<th width="5%">序号</th>
			     		<th width="20%">企业名称</th>
			     		<th width="4%">级别</th>
			     		<th width="5%">上报类别</th>
			     		<th width="12%">行业部门</th>
			     		<th width="7%">自查次数</th>
			     		<th width="7%">自查总项</th>
			     		<th width="7%">不合数</th>
			     		<th width="7%">未处理数</th>
			     		<th width="7%">查看情况</th>
			     		<th width="7%">核查情况</th>
			     		<th width="12%">操作</th>
			    	</tr>
		   		</thead>
			   	<tbody>
			   		<s:if test="%{objList.size>0}">
			   			<s:iterator value="objList" id="obj" status="x">
				   			<tr>
					     		<td align="center">${x.index+1+(page.num-1)*page.size}</td>
					     		<td align="left"><a href="<%=basePath%>/enterprise/corp_look.action?corpId=${obj.corpId }" target="_blank" title="${obj.corpName}">${obj.corpName }</a></td>
					     		<td align="center">${obj.corpGrade }</td>
					     		<td align="center">${obj.reportType == 1?"月报":"半月报" }</td>
					     		<td align="center">${obj.deptMainName }</td>
					     		<td align="center">${obj.hzdBgdNum }</td>
					     		<td align="center">${obj.hzdItemNum }</td>
					     		<td align="center"><font color="red">${obj.hzdYhNum }</font></td>
					     		<td align="center"><font color="red">${obj.hzdWclNum }</font></td>
					     		<td align="center">
					     			<s:if test="%{#obj.hzdLooks==0}"><font color="red">未查看</font></s:if>
					     			<s:else><a href="javascript:void(0);" onclick="doFun('4','${obj.id }');" title="部门查看情况">${obj.hzdLooks }</a></s:else> 
					     		</td>
					     		<td align="center">
					     			<s:if test="%{#obj.hzdChecks==0}"><font color="red">未核查</font></s:if>
					     			<s:else><a href="javascript:void(0);" onclick="doFun('5','${obj.id }');" title="部门核查情况">${obj.hzdChecks }</a></s:else>
					     		</td>
					     		<td align="center">
						     		<a href="javascript:void(0);" onclick="doFun('1','${obj.id }');" title="查看上报详细信息">查看</a>
						     		<a href="javascript:void(0);" onclick="doFun('2','${obj.id }');" title="填写核查结果">核查</a>
						     		<a href="javascript:void(0);" onclick="doFun('3','${obj.id }');" title="将企业上报数据删除，让企业重新填写上报！">删除</a>
					     		</td>
					    	</tr>
			   			</s:iterator>
			    	</s:if>
			    	<s:else>
				    	<tr>
				     		<td align="center" colspan="12">暂无上报数据</td>
				    	</tr>
			    	</s:else>
			   	</tbody>
		  	</table>
		  	<div class="page">
				<jsp:include flush="true" page="../share/fenye.jsp">
				    <jsp:param name="url4page" value="/zczb/xw_list.action?${urls }" />
			    </jsp:include>	
		    </div>
	 	</div>
	</div>
	<form action="<%=basePath %>/zczb/xw_list.action?${urls }" name="form1" method="post">
		<input type="hidden" name="hzdId" value="">
		<input type="hidden" name="urls" value="${urls }">
		<input type="hidden" name="num" value="${page.num }">
		<input type="hidden" name="size" value="${page.size }">
	</form>
  </body>
  <s:if test="%{tip!=null}">
    	<script>
    		alert('${tip}');
    	</script>
    </s:if>
</html>
